package com.fengke.dao.model;

public class Sn extends BaseEntity {
	private static final long serialVersionUID = -7681587335637552902L;

	/**
	 * 类型
	 */
	public enum Type {

		/** 商品 */
		product(0),

		/** 订单 */
		order(1),

		/** 收款单 */
		payment(2),

		/** 退款单 */
		refunds(3),

		/** 发货单 */
		shipping(4),

		/** 退货单 */
		returns(5);

		private int type;

		Type(int type) {
			this.type = type;
		}

		public int getType() {
			return type;
		}
	}

	/** 类型 */
	private Type type;
	/** 末值 */
	private Long lastValue;
	
	private Integer mtype;

	public Type getType() {
		return type;
	}

	public void setType(Type type) {
		this.type = type;
	}

	public Long getLastValue() {
		return lastValue;
	}

	public void setLastValue(Long lastValue) {
		this.lastValue = lastValue;
	}

	public Integer getMtype() {
		this.mtype = this.type.getType();
		return this.mtype;
	}

	public void setMtype(Integer mtype) {
		if(mtype == null) {
			return;
		}
		if(mtype == Type.product.getType()) {
			this.type = Type.product;
		} else if(mtype == Type.order.getType()) {
			this.type = Type.order;
		} else if(mtype == Type.payment.getType()) {
			this.type = Type.payment;
		} else if(mtype == Type.refunds.getType()) {
			this.type = Type.refunds;
		} else if(mtype == Type.shipping.getType()) {
			this.type = Type.shipping;
		} else if(mtype == Type.returns.getType()) {
			this.type = Type.returns;
		}
		this.mtype = this.type.getType();
	}
}
